﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameMain : MonoBehaviour {

	public GameObject isLandObj;
	int createCount = 8;

	// Use this for initialization
	void Start () 
	{
		CreateIslandAtBegin();
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	void CreateIslandAtBegin()
	{
		for(int i = 0; i < createCount - 1; i++)
		{
			var newObj = GameObject.Instantiate(isLandObj);
			newObj.transform.SetParent(isLandObj.transform.parent);

			newObj.transform.localScale = Vector3.one;
			var component = newObj.transform.GetComponent<RotateMove>();
			component.rotateAngle = (i+1) * (360 / createCount);
		}
	}
}
